#ifndef __SKELETON_H__
#define __SKELETON_H__

#include <export.h>
#include <iobject.h>
#include <list>
#include <map>
#include <math/matrix.h>
#include <scene/skeletonbone.h>

/**
 * \addtogroup scene
 * @{
 */

/**
 * @brief A ceSkeletonBone based skeleton.
 */
class CE_API ceSkeleton : public iObject
{
  CE_OBJECT
private:
  ceMatrix4f*											_matrices;
	ceMatrix4f*											_neutralMatrices;

  ceSkeletonBone*									_rootBone;
	std::vector<ceSkeletonBone*>		_bones;

public:
  ceSkeleton();

  void AddBone (ceSkeletonBone* bone, ceSkeletonBone* parent = 0);
  void RemoveBone (ceSkeletonBone* bone);
  void SetRootBone (ceSkeletonBone* bone);

	void Initialize (const ceMatrix4f& matrix = ceMatrix4f());
	void Update (const ceMatrix4f& matrix = ceMatrix4f());

	unsigned GetNumberOfBones () const;
	const ceMatrix4f* GetBoneMatrices () const;

  ceSkeletonBone* GetBone (unsigned idx);
  const ceSkeletonBone* GetBone (unsigned idx) const;

  ceSkeletonBone* GetBone (const std::string& name);
  const ceSkeletonBone* GetBone (const std::string& name) const;

};

/**
 * @}
 */

#endif /* ! __SKELETON_H__ */
